Skip to content

Add Zcash regtest end-to-end test coverage - #1564

Draft
sneurlax wants to merge 3 commits into
feat/zcashfrom
feat/zcash-e2e
Draft

sneurlax wants to merge 3 commits into
feat/zcashfrom
feat/zcash-e2e

Conversation

@sneurlax

@sneurlax sneurlax commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add an end-to-end test that drives the real ZcashWallet and the real zcash-ffi library against a local regtest chain: zebrad as the node and lightwalletd in front of it.
  • Add scripts/zcash_e2e_test.sh, which checks the app is configured with Zcash and runs the test, and a section in docs/building/testing.md.

The test is self-contained: it starts both daemons on free ports in a temporary directory and stops them at the end. It needs no regtest infrastructure from elsewhere in the app and touches no shared code. CI does not run it, because CI has no zebrad or lightwalletd.

Stacked on #1563.

What it covers

One scenario, in the order a user meets it:

  • A new wallet takes its birthday from the node's tip.
  • Receive: a payment is not counted from the mempool, and is counted and spendable with its first confirmation, with the block's time.
  • Send with a memo: listed as unconfirmed once broadcast, with the payment and fee out of the balance and the change pending; then mined, with the same row updated.
  • The recipient wallet sees the payment and can spend it back.
  • Restore from the phrase at the birthday height finds the same balance and history.
  • The fee estimate matches the fee of the prepared send.

The wallet under test runs the same configuration as on mainnet: the regtest network only changes the address encoding and the activation height the builder is told.

Commits

  1. test: add Zcash regtest end-to-end coverage.

Size

4 files, +813: the chain driver (integration_test/zcash/zcash_regtest_chain.dart), the test, the script, and the docs section.

Running it

ZEBRAD_BIN=/path/to/zebrad LIGHTWALLETD_BIN=/path/to/lightwalletd \
  scripts/zcash_e2e_test.sh linux

It is tested with zebrad 7.0.0 and lightwalletd 0.6.1. On a machine without a display, run it under xvfb-run -a.

Verification

At this PR's head (53cd4efcc):

  • xvfb-run -a bash scripts/zcash_e2e_test.sh linux with zebrad 7.0.0 and lightwalletd 0.6.1: 1/1, in about a minute after the build.
  • flutter analyze on the changed Dart files: no errors.
  • CI's format check on the changed Dart files: clean.
  • The full flutter test suite: 1559 passed, 8 skipped, and four Firo cache tests (in firo_cache_clear_test.dart, firo_cache_reset_lifecycle_test.dart and firo_cache_refresh_reset_test.dart) that time out in full runs on this machine and pass when those files are run on their own (17/17). This PR adds no unit tests.

@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/zcash@c92fd8f). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff              @@
##             feat/zcash    #1564   +/-   ##
=============================================
  Coverage              ?   21.80%           
=============================================
  Files                 ?     1157           
  Lines                 ?   116360           
  Branches              ?        0           
=============================================
  Hits                  ?    25374           
  Misses                ?    90986           
  Partials              ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant